package com.dubito.dose.feature.calendar.navigation

import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.dubito.dose.core.navigation.DoseNavigationDestination
import com.dubito.dose.feature.calendar.CalendarRoute

/**
 * author: LiLiang
 * createTime: 2022/9/4-0:08
 * remark:
 **/
object CalendarDestination : DoseNavigationDestination {
    override val route: String
        get() = "calendar_route"
    override val destination: String
        get() = "calendar_destination"
}

fun NavGraphBuilder.calendarGraph(
    bottomBarVisibility: MutableState<Boolean>,
    fabVisibility: MutableState<Boolean>
) {
    composable(CalendarDestination.route) {
        LaunchedEffect(null) {
            bottomBarVisibility.value = true
            fabVisibility.value = true
        }
        CalendarRoute()
    }
}